home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1138 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.0 KB

  1. Path: fido.asd.sgi.com!austern
  2. From: jpotter@falcon.lhup.edu (John E. Potter)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: dynamic_cast
  5. Date: 17 Apr 1996 10:41:42 PDT
  6. Organization: East Stroudsburg University, Pennsylvania
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4l2lls$79m@jake.esu.edu>
  9. References: <4kmdqk$kjk@jake.esu.edu> <u9pw9askr1.fsf@yorick.cygnus.com>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. X-Original-Date: 17 Apr 1996 11:46:04 GMT
  12. X-Newsreader: TIN [version 1.2 PL2]
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMXUtV0y4NqrwXLNJAQGR9gH/YO0uSKAW0Itp6xR6Q5r9Mwn09zBPiDDY
  15.     moQj7FPZabIyJC1szO/oa/y9RUJOxkyeRmEqAcKGGxQLu4h+YxAEyA==
  16.     =NNIY
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. Jason Merrill (jason@cygnus.com) wrote:
  20. : >>>>> John E Potter <jpotter@falcon.lhup.edu> writes:
  21.  
  22. : > In trying to trace a perceived bug in g++2.7.2 to the DWP, I
  23. : > found that it seems vague.  I have paraphrased to save space.  If
  24. : > I messed it up, say so.  In the following, assume B is a polymorphic
  25. : > base of D and that A is unrelated.
  26.  
  27. : I think the WP is pretty clear that a null pointer should not be adjusted
  28. : or dereferenced.  I have fixed this in g++ for 2.8.
  29.  
  30. That was also my first impression; however, the more I read it the less
  31. clear it became.  The two options were: (1) Make a run time test for
  32. null pointer in all cases like delete.  (2) Let the user beware of null
  33. pointers like all other cases.  Not sure what the committee intended.
  34.  
  35. Did you also change it to allow dynamic_cast<Some*>(0)?  I thought that
  36. that g++ error was correct after several reads.
  37.  
  38. What about the dynamic_cast<Unrelated*>(SomePolymorphic*)?  Is that a
  39. compile time error or a run time test which always fails?
  40.  
  41. Thanks,
  42. John
  43. ---
  44. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  45.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  46.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  47.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  48.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  49. ]
  50.